package zuoye.宠物店;

public class Feeder {
    String name;

    public double feedAnimal(Animal animal, Food food, int amount) {
        animal.eat(food.getFoodName());
        return food.getFoodPrice() * amount;
    }

    public void playAnimal(Animal animal) {
        if (animal instanceof Cat) {
            Cat cat = (Cat) animal;
            cat.play();
        } else if (animal instanceof Dog) {
            Dog dog = (Dog) animal;
            dog.play();
        }
    }

    public double washAnimal(Animal animal) {
        double washPrice = 0;
        if (animal.getHair()) washPrice =  200;
        else washPrice = 100;
        return washPrice;
    }

    public double workAnimal(Animal animal) {
        if (animal instanceof Dog) {
            ((Dog) animal).Work();
        }
        return 10;
    }
}





